#include "Data.h"


/* ----- Test Class Test -------------------------------------------------------------------------------------------- */

void Data::testTest(int whichTest, Correlation *c) {

    // No data to load
    return;
}


/* ----- Class Implementation Functions ----------------------------------------------------------------------------- */

void Data::correlationConstructor(int whichTest, Correlation *c) {

    /* ----- Initialize Local Variables ----------------------------------------------------------------------------- */

    // Image arrays
    colorSpace = 0;
    colorSpacePrev = 0;


    /* ----- Initialize Global Variables ---------------------------------------------------------------------------- */

    // Runtime logic
    enable_debug = 0;  // Call function with --enable-debug to output spiffy stuff during analysis
    enable_step = false;  // Pause after outputting image every time step
    image_sequence = -1;  // Flag -is=### runs with pre-stored image sequence number ###

    // Image data
    h = -1;
    w = -1;
    ROI.x = 0;
    ROI.y = 0;
    ROI.width = 100;
    ROI.height = 100;


    // Image filter logic variables
    H_lower = 85;
    H_upper = 170;
    S_lower = 85;
    S_upper = 170;
    V_lower = 85;
    V_upper = 170;

    R_lower = 85;
    R_upper = 170;
    G_lower = 85;
    G_upper = 170;
    B_lower = 85;
    B_upper = 170;

    // Blob analysis logic variables
    num_blobs = 0;
    found = 0;
    min_blob_area = 0;
    max_blob_area = 10000;

    // Post process logic variables
    blob_dist_thresh = 50;  // Static migration distance threshold
    // Position field logic variables
    int area_thresh = 25;
    int num_dots = 0;
    double migration_dist_thresh = 50;

    // Position field data

    // Variables used for generateGridMap()
    min_direction_angle = 20*M_PI/180;  // Units are radians
    max_direction_angle = 160*M_PI/180;
    max_neighbor_dist = 10000;

    //tmp
    t = 0;
    dotProbabilityThresh = 0.9;

    for(int b = 0; b < max_num_blobs; ++b) {
        epsxx[b] = 0;
        epsxy[b] = 0;
        epsyx[b] = 0;
        epsyy[b] = 0;
    }

    return;
}


/* ----- Level 0 Functions ------------------------------------------------------------------------------------------ */

bool Data::analyzeImage(int whichTest, Correlation *c) {

    // Load image sequence into the data object
    pathNames[0] = "/home/david/Documents/correlate/outputfiles";
    pathNames[1] = "/home/david/Documents/test-correlate/unittestdata/";

    char fCharArray[40];
    for(int i = 0; i < 1000; ++i) {

        // Write the maximum number of potential filenames. Maximum number is currently hard-coded.
        //   Note: Most of these images do not exist. However, the correlation object fails gracefully and the RunTest
        //     test handles this appropriately.
        fileNames[i] = "";
        sprintf(fCharArray, "test%uplt%u.bmp", whichTest, i);
        fileNames[i].append(fCharArray);
    }

    // Load point sets into data object
    loadPointSet(whichTest);

    // Open file containing threshold values
    string path = "/home/david/Documents/correlate/data/persistentValues.dat";
    ofstream persistentValues( path.c_str(), ios::out );

    // Check for correct file opening
    if(!persistentValues.is_open()) {
        std::cout << "Error opening persistentValues.dat." << endl;
    }

    // Overwrite file containing thresholds
    persistentValues << "0" << endl;
    persistentValues << "256" << endl;
    persistentValues << "0" << endl;
    persistentValues << "256" << endl;
    persistentValues << "0" << endl;
    persistentValues << "256" << endl;
    persistentValues << "10" << endl;
    persistentValues << "246" << endl;
    persistentValues << "0" << endl;
    persistentValues << "256" << endl;
    persistentValues << "0" << endl;
    persistentValues << "256";

//    persistentValues << "0" << endl;
//    persistentValues << "225" << endl;
//    persistentValues << "0" << endl;
//    persistentValues << "256" << endl;
//    persistentValues << "0" << endl;
//    persistentValues << "256" << endl;
//    persistentValues << "0" << endl;
//    persistentValues << "256" << endl;
//    persistentValues << "12" << endl;
//    persistentValues << "256" << endl;
//    persistentValues << "0" << endl;
//    persistentValues << "256";

    // Close persistent values file
    persistentValues.close();

    // Load params into correlation object
    c->initObject();  // Loads new threshold values
    c->ROI.x = 0;
    c->ROI.y = 0;
    c->blob_dist_thresh = 5;
    c->area_thresh = 5; //10;

    cout << pathNames[0] << " " << pathNames[1] << " " << fileNames[0] << endl;
    c->analyzeImage(pathNames[0], pathNames[1], fileNames[0], true);  // Load first image only to get ROI size
    cout << "step" << endl;
    cout << c->imgInFull.imgp->nChannels << endl;
    c->ROI.width = c->imgInFull.imgp->width;  // Use entire image as ROI
    cout << "step" << endl;
    c->ROI.height = c->imgInFull.imgp->height;




    //parameters for debug that probably shouldn't be changed
    c->migration_dist_thresh = 8;





    return true;
}

void Data::storePositionField(int whichTest, Correlation *c) {
    return;
}
void Data::storeStrainField(int whichTest, Correlation *c) {
    return;
}
void Data::outputImage(int whichTest, Correlation *c) {
    return;
}
void Data::outputOverlay(int whichTest, Correlation *c) {
    return;
}


/* ----- Level 1 Functions ------------------------------------------------------------------------------------------ */

void Data::loadPersistentValues(int whichTest, Correlation *c) {
    return;
}

void Data::savePersistentValues(int whichTest, Correlation *c) {
    return;
}

bool Data::inputImage(int whichTest, Correlation *c) {
        return false;
    }
void Data::blobAnalysis(int whichTest, Correlation *c) {
        return;
    }
void Data::extractPositionField(int whichTest, Correlation *c) {
        return;
    }
/*
  */
void Data::generateGridMap(int whichTest, Correlation *c) {

    /*
    // Clear out positionField_ref and gridMap
    for(int b = 0; b < 1000; ++b) {
        c->positionField_ref[0][b] = -1;
        c->positionField_ref[1][b] = -1;
        for(int n = 0; n < 36; ++n) {
            gridMap[n][b] = -1;
        }
    }

    // Load sparse data into positionField_ref[][]
    switch(whichTest) {
    case 0:

        // Simple, linear set of points
        c->positionField_ref[0][0] = 140;
        c->positionField_ref[1][0] = 425;
        c->positionField_ref[0][1] = 284;
        c->positionField_ref[1][1] = 425;
        c->positionField_ref[0][2] = 432;
        c->positionField_ref[1][2] = 425;
        c->positionField_ref[0][3] = 584;
        c->positionField_ref[1][3] = 425;
        c->positionField_ref[0][4] = 740;
        c->positionField_ref[1][4] = 425;

        // Expected values in gridMap
        gridMap[0][0] = 1;
        gridMap[1][0] = 2;
        gridMap[2][0] = 3;
        gridMap[3][0] = 4;
        gridMap[4][0] = -1;

        gridMap[0][1] = 0;
        gridMap[1][1] = 2;
        gridMap[2][1] = 3;
        gridMap[3][1] = 4;
        gridMap[4][1] = -1;

        gridMap[0][2] = 1;
        gridMap[1][2] = 3;
        gridMap[2][2] = 0;
        gridMap[3][2] = 4;
        gridMap[4][2] = -1;

        gridMap[0][3] = 2;
        gridMap[1][3] = 4;
        gridMap[2][3] = 1;
        gridMap[3][3] = 0;
        gridMap[4][3] = -1;

        gridMap[0][4] = 3;
        gridMap[1][4] = 2;
        gridMap[2][4] = 1;
        gridMap[3][4] = 0;
        gridMap[4][4] = -1;

        break;
    }

    */
    return;
}

void Data::computeStrain(int whichTest, Correlation *c) {

    /*

    switch(whichTest) {
    case 0:

        // Loop through the point sets in loadLocalStrain(), and assign to points in positionField_ref and positionField
        int s(0);
        for(s = 0; s < 8; ++s) {
            localStrain(c, s);
            c->positionField_ref[0][3*s] = pt[0][0];
            c->positionField_ref[1][3*s] = pt[1][0];
            c->positionField_ref[0][3*s+1] = pt[0][1];
            c->positionField_ref[1][3*s+1] = pt[1][1];
            c->positionField_ref[0][3*s+2] = pt[0][2];
            c->positionField_ref[1][3*s+2] = pt[1][2];

            c->positionField[0][3*s] = ptStar[0][0];
            c->positionField[1][3*s] = ptStar[1][0];
            c->positionField[0][3*s+1] = ptStar[0][1];
            c->positionField[1][3*s+1] = ptStar[1][1];
            c->positionField[0][3*s+2] = ptStar[0][2];
            c->positionField[1][3*s+2] = ptStar[1][2];
        }

        // Clear out gridMap and populate positionField_ref and positionField with -1 for unused values
        for(int b = 0; b < 1000; ++b) {
            if(b >= 3*(s-1)+3) {
                c->positionField_ref[0][b] = -1;
                c->positionField_ref[1][b] = -1;
                c->positionField[0][b] = -1;
                c->positionField[1][b] = -1;
            }
            for(int n = 0; n < 36; ++n) {
                gridMap[n][b] = -1;
            }
        }

        // Assign a gridMap which will trick the computeStrain() function into calculating strain at the desired points
        for(int p = 0; p < 1000; ++p) {
            for(int n = 0; n < 36; ++n) {
                c->gridMap[n][p] = -1;
            }
        }
        for(int p = 0; p < s; ++p) {
            c->gridMap[0][3*p] = 3*p+1;
            c->gridMap[1][3*p] = 3*p+2;
            c->gridMap[0][3*p+1] = 3*p;
            c->gridMap[1][3*p+1] = 3*p+2;
            c->gridMap[0][3*p+2] = 3*p;
            c->gridMap[1][3*p+2] = 3*p+1;

            for(int n = 2; n < 36; ++n) {
                c->gridMap[n][3*p] = -1;
                c->gridMap[n][3*p+1] = -1;
                c->gridMap[n][3*p+2] = -1;
            }
        }

        // Assign expected strain values
        for(int p = 0; p < 1000; ++p) {
            epsxxC[p] = 0;
            epsxyC[p] = 0;
            epsyxC[p] = 0;
            epsyyC[p] = 0;
        }
        epsxxC[0] = -1.30782*pow(10, -16);
        epsxyC[0] = -3.33539*pow(10, -6);
        epsyxC[0] = -3.33539*pow(10, -6);
        epsyyC[0] = 0.0000115542;

        epsxxC[3] = 9.75582*pow(10, -6);
        epsxyC[3] = 8.44903*pow(10, -6);
        epsyxC[3] = 8.44903*pow(10, -6);
        epsyyC[3] = -1.11022*pow(10, -16);

        epsxxC[6] = -0.0632964;
        epsxyC[6] = 0.179204;
        epsyxC[6] = 0.179204;
        epsyyC[6] = 0.00312304;

        epsxxC[9] = 0.0207018;
        epsxyC[9] = -0.0564137;
        epsyxC[9] = -0.0564137;
        epsyyC[9] = -0.0260408;

        epsxxC[12] = -0.0784442;
        epsxyC[12] = -0.0525504;
        epsyxC[12] = -0.0525504;
        epsyyC[12] = -0.0729407;

        epsxxC[15] = -0.0424969;
        epsxyC[15] = 0.0525525;
        epsyxC[15] = 0.0525525;
        epsyyC[15] = -0.036994;

        epsxxC[18] = -8.76375*pow(10, -8);
        epsxyC[18] = 4.94335*pow(10, -6);
        epsyxC[18] = 4.94335*pow(10, -6);
        epsyyC[18] = 0.0000131805;

        epsxxC[21] = 0.;
        epsxyC[21] = 3.24122*pow(10, -16);
        epsyxC[21] = 3.24122*pow(10, -16);
        epsyyC[21] = -0.0000767843;

        break;
//    case 1:
//        //
//        break;
    }


    // Apply angle tolerances specific to this testing data
    c->min_direction_angle = 60*M_PI/180;
    c->max_direction_angle = 172*M_PI/180;


    */



    return;
}


void Data::drawCurrentState(int whichTest, Correlation *c) {
        return;
    }


/* ----- Level 2 Functions ------------------------------------------------------------------------------------------ */

void Data::subsetImage(int whichTest, Correlation *c) {
        return;
    }
void Data::filterImage(int whichTest, Correlation *c) {
        return;
    }
void Data::matchBlob(int whichTest, Correlation *c) {
        return;
    }
void Data::updateBoundingBox(int whichTest, Correlation *c) {
        return;
    }
void Data::mergeBlobs(int whichTest, Correlation *c) {
        return;
    }
void Data::postProcess(int whichTest, Correlation *c) {
        return;
    }
void Data::blobProbability(int whichTest, Correlation *c) {
        return;
    }
void Data::identifyDots(int whichTest, Correlation *c) {
        return;
    }
void Data::isValidPointSet(int whichTest, Correlation *c) {


    /*
    // This data does accurately test the possible situations

    // Force logic parameters approprate to the test data
    c->min_direction_angle = 85*M_PI/180;
    c->max_direction_angle = 95*M_PI/180;

    // Load test data
    switch(set) {
    case 0:
        pt[0][0] =       1;
        pt[1][0] =       1;
        pt[0][1] =  3.5981;
        pt[1][1] =     2.5;
        pt[0][2] =  2.4084;
        pt[1][2] = -1.6488;
        ptStar[0][0] =       2;
        ptStar[1][0] =       3;
        ptStar[0][1] =  4.5981;
        ptStar[1][1] =     4.5;
        ptStar[0][2] =  3.4084;
        ptStar[1][2] = 0.35116;
        break;
    case 1:
        pt[0][0] =       0;
        pt[1][0] =       0;
        pt[0][1] =  1.7321;
        pt[1][1] =      -1;
        pt[0][2] = -1.0598;
        pt[1][2] = -1.6961;
        ptStar[0][0] =         1;
        ptStar[1][0] =         2;
        ptStar[0][1] =    2.7321;
        ptStar[1][1] =         1;
        ptStar[0][2] = -0.059839;
        ptStar[1][2] =    0.3039;
        break;
    case 2:
        pt[0][0] =       0;
        pt[1][0] =       0;
        pt[0][1] =  2.9544;
        pt[1][1] = 0.52094;
        pt[0][2] = 0.57243;
        pt[1][2] = -2.9449;
        ptStar[0][0] =        1;
        ptStar[1][0] =        2;
        ptStar[0][1] =   3.9544;
        ptStar[1][1] =   2.5209;
        ptStar[0][2] =  0.47906;
        ptStar[1][2] = -0.95442;
        break;
    case 3:
        pt[0][0] =       0;
        pt[1][0] =       0;
        pt[0][1] =  2.9544;
        pt[1][1] = 0.52094;
        pt[0][2] =  0.4693;
        pt[1][2] = -2.9631;
        ptStar[0][0] =        1;
        ptStar[1][0] =        2;
        ptStar[0][1] =   3.9544;
        ptStar[1][1] =   2.5209;
        ptStar[0][2] =   1.8269;
        ptStar[1][2] = -0.88379;
        break;
    case 4:
        pt[0][0] =        0;
        pt[1][0] =        0;
        pt[0][1] =   2.9544;
        pt[1][1] = -0.52094;
        pt[0][2] = -0.82691;
        pt[1][2] =  -2.8838;
        ptStar[0][0] =        1;
        ptStar[1][0] =        2;
        ptStar[0][1] =   3.9544;
        ptStar[1][1] =   2.5209;
        ptStar[0][2] =   1.5209;
        ptStar[1][2] = -0.95442;
        break;
    case 5:
        pt[0][0] =        0;
        pt[1][0] =        0;
        pt[0][1] =   2.9544;
        pt[1][1] = -0.52094;
        pt[0][2] = -0.20927;
        pt[1][2] =  -2.9927;
        ptStar[0][0] =        1;
        ptStar[1][0] =        2;
        ptStar[0][1] =   3.9544;
        ptStar[1][1] =   2.5209;
        ptStar[0][2] =   1.5209;
        ptStar[1][2] = -0.95442;
        break;
    case 6:
        pt[0][0] =         0;
        pt[1][0] =         0;
        pt[0][1] =    2.9886;
        pt[1][1] =   0.26147;
        pt[0][2] = -0.052357;
        pt[1][2] =   -2.9995;
        ptStar[0][0] =        1;
        ptStar[1][0] =        2;
        ptStar[0][1] =   3.9886;
        ptStar[1][1] =   2.2615;
        ptStar[0][2] =  0.94764;
        ptStar[1][2] = -0.99954;
        break;
    case 7:
        pt[0][0] =       0;
        pt[1][0] =       0;
        pt[0][1] =       3;
        pt[1][1] =       0;
        pt[0][2] = -2.9544;
        pt[1][2] = 0.52094;
        ptStar[0][0] =       1;
        ptStar[1][0] =       2;
        ptStar[0][1] =       4;
        ptStar[1][1] =       2;
        ptStar[0][2] = -1.9544;
        ptStar[1][2] =  2.5209;
        break;
    }

    */

    return;
}


void Data::localStrain(int whichTest, Correlation *c) {


    /*
    // This data does accurately test the possible situations

    // Load point set
    isValidPointSet(c, set);

    // Load correct strain values
    switch(set) {
    case 0:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = -1.30782e-16;
            epsCCorrect[1][n] = -3.33539e-6;
            epsCCorrect[2][n] = -3.33539e-6;
            epsCCorrect[3][n] = 0.0000115542;
        }
        break;
    case 1:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = 9.75582e-6;
            epsCCorrect[1][n] = 8.44903e-6;
            epsCCorrect[2][n] = 8.44903e-6;
            epsCCorrect[3][n] = -1.11022e-16;
        }
        break;
    case 2:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = -0.0632964;
            epsCCorrect[1][n] = 0.179204;
            epsCCorrect[2][n] = 0.179204;
            epsCCorrect[3][n] = 0.00312304;
        }
        break;
    case 3:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = 0.0207018;
            epsCCorrect[1][n] = -0.0564137;
            epsCCorrect[2][n] = -0.0564137;
            epsCCorrect[3][n] = -0.0260408;
        }
        break;
    case 4:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = -0.0784442;
            epsCCorrect[1][n] = -0.0525504;
            epsCCorrect[2][n] = -0.0525504;
            epsCCorrect[3][n] = -0.0729407;
        }
        break;
    case 5:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = -0.0424969;
            epsCCorrect[1][n] = 0.0525525;
            epsCCorrect[2][n] = 0.0525525;
            epsCCorrect[3][n] = -0.036994;
        }
        break;
    case 6:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = -8.76375e-8;
            epsCCorrect[1][n] = 4.94335e-6;
            epsCCorrect[2][n] = 4.94335e-6;
            epsCCorrect[3][n] = 0.0000131805;
        }
        break;
    case 7:
        for(int n = 0; n < 3; ++n) {
            epsCCorrect[0][n] = 0.;
            epsCCorrect[1][n] = 3.24122e-16;
            epsCCorrect[2][n] = 3.24122e-16;
            epsCCorrect[3][n] = -0.0000767843;
        }
        break;
    }

*/

    return;

}


double Data::minAbs(int whichTest, Correlation *c) {
    return 0;
}


double Data::maxAbs(int whichTest, Correlation *c) {
    return 0;
}


void Data::minIgnore(int whichTest, Correlation *c) {
        return;
    }
void Data::maxIgnore(int whichTest, Correlation *c) {
        return;
    }
void Data::drawBlobProperty(int whichTest, Correlation *c) {
        return;
    }
void Data::drawCurrentPixel(int whichTest, Correlation *c) {
        return;
    }
void Data::debugHandle(int whichTest, Correlation *c) {
        return;
    }


/* ----- Data Class Helper Functions -------------------------------------------------------------------------------- */


/*
  Load a particular set of points for:
    1) Position field
    2) Strain field

  Note that this function only loads points for two time steps - the reference and one deformed configuration
  */
void Data::loadPointSet(int whichPointSet) {

    // Reference position field
    positionField_ref[0][0] = 0;
    positionField_ref[1][0] = 0;
    positionField_ref[0][1] = 16;
    positionField_ref[1][1] = 0;
    positionField_ref[0][2] = 16;
    positionField_ref[1][2] = 16;
    positionField_ref[0][3] = 0;
    positionField_ref[1][3] = 16;

    // Position field of deformed configuration
    switch(whichPointSet) {
    case 0:
        positionField[0][0] = 16;
        positionField[1][0] = 24;
        positionField[0][1] = 32;
        positionField[1][1] = 24;
        positionField[0][2] = 32;
        positionField[1][2] = 40;
        positionField[0][3] = 16;
        positionField[1][3] = 40;
        break;
    case 1:
        positionField[0][0] = -1.047;
        positionField[1][0] = 3.141;
        positionField[0][1] = 14.953;
        positionField[1][1] = -1.047;
        positionField[0][2] = 19.141;
        positionField[1][2] = 14.953;
        positionField[0][3] = 3.141;
        positionField[1][3] = 19.141;
        break;
    case 2:
        positionField[0][0] = 10;
        positionField[1][0] = 10;
        positionField[0][1] = 58;
        positionField[1][1] = 10;
        positionField[0][2] = 58;
        positionField[1][2] = 26;
        positionField[0][3] = 10;
        positionField[1][3] = 26;
        break;
    case 3:
        positionField[0][0] = 13;
        positionField[1][0] = 10;
        positionField[0][1] = 29;
        positionField[1][1] = 10;
        positionField[0][2] = 29;
        positionField[1][2] = 58;
        positionField[0][3] = 13;
        positionField[1][3] = 58;
        break;
    case 4:
        positionField[0][0] = 10;
        positionField[1][0] = 10;
        positionField[0][1] = 34;
        positionField[1][1] = 10;
        positionField[0][2] = 34;
        positionField[1][2] = 18;
        positionField[0][3] = 10;
        positionField[1][3] = 18;
        break;
    case 5:
        positionField[0][0] = 10;
        positionField[1][0] = 10;
        positionField[0][1] = 26;
        positionField[1][1] = 14.18;
        positionField[0][2] = 26;
        positionField[1][2] = 30.18;
        positionField[0][3] = 10;
        positionField[1][3] = 26;
        break;
    case 6:
        positionField[0][0] = 12.09;
        positionField[1][0] = 10;
        positionField[0][1] = 28.09;
        positionField[1][1] = 10;
        positionField[0][2] = 23.91;
        positionField[1][2] = 26;
        positionField[0][3] = 7.91;
        positionField[1][3] = 26;
        break;
    case 7:
        positionField[0][0] = 10;
        positionField[1][0] = 10;
        positionField[0][1] = 26;
        positionField[1][1] = 14.18;
        positionField[0][2] = 30.18;
        positionField[1][2] = 30.18;
        positionField[0][3] = 14.18;
        positionField[1][3] = 26;
        break;
    case 8:
        positionField_ref[0][0] = 0;
        positionField_ref[1][0] = 0;
        positionField_ref[0][1] = 32;
        positionField_ref[1][1] = 0;
        positionField_ref[0][2] = 32;
        positionField_ref[1][2] = 32;
        positionField_ref[0][3] = 0;
        positionField_ref[1][3] = 32;

        positionField[0][0] = 10;
        positionField[1][0] = 15;
        positionField[0][1] = 58;
        positionField[1][1] = 18.2;
        positionField[0][2] = 58;
        positionField[1][2] = 58.2;
        positionField[0][3] = 10;
        positionField[1][3] = 55;
        break;
    }

    // Strain field for second time step. By definition the strain field is zero for the first time step.
    switch(whichPointSet) {
    case 0:
        epsxx[0] = 0;
        epsxy[0] = 0;
        epsyx[0] = 0;
        epsyy[0] = 0;
        break;
    case 1:
        epsxx[0] = 0;
        epsxy[0] = 0;
        epsyx[0] = 0;
        epsyy[0] = 0;
        break;
    case 2:
        epsxx[0] = 2;
        epsxy[0] = 0;
        epsyx[0] = 0;
        epsyy[0] = 0;
        break;
    case 3:
        epsxx[0] = 0;
        epsxy[0] = 0;
        epsyx[0] = 0;
        epsyy[0] = 2;
        break;
    case 4:
        epsxx[0] = .5;
        epsxy[0] = 0;
        epsyx[0] = 0;
        epsyy[0] = -0.5;
        break;
    case 5:
        epsxx[0] = 0;
        epsxy[0] = 0.1309;
        epsyx[0] = 0.1309;
        epsyy[0] = 0;
        break;
    case 6:
        epsxx[0] = 0;
        epsxy[0] = -0.1309;
        epsyx[0] = -0.1309;
        epsyy[0] = 0;
        break;
    case 7:
        epsxx[0] = 0;
        epsxy[0] = 0.2618;
        epsyx[0] = 0.2618;
        epsyy[0] = 0;
        break;
    case 8:
        epsxx[0] = 0.5;
        epsxy[0] = 0.05;
        epsyx[0] = 0.05;
        epsyy[0] = 0.25;
        break;
    }

    return;
}





///*
//  Getter function for pt[][].

//  @output = pointer to the pt[][] array
//  */
////double *Data::getPt() {
////    return &pt[0][0];
////}


///*
//  Getter function for ptStar[][].

//  @output = pointer to the ptStar[][] array
//  */
////double *Data::getPtStar() {
////    return &ptStar[0][0];
////}


///*
//  Setter function for pt[][].

//  @input = pointer to the new pt[][] array
//  */
//void Data::Data::setPt( double (*pti)[2][3] ) {
//    pt[0][0] = *pti[0][0];
//    pt[1][0] = *pti[1][0];
//    pt[0][1] = *pti[0][1];
//    pt[1][1] = *pti[1][1];
//    pt[0][2] = *pti[0][2];
//    pt[1][2] = *pti[1][2];
//    return;
//}


///*
//  Setter function for ptStar[][].

//  @input = pointer to the new ptStar[][] array
//  */
//void Data::Data::setPtStar( double (*ptiStar)[2][3] ) {
//    //
//    ptStar[0][0] = *ptiStar[0][0];
//    ptStar[1][0] = *ptiStar[1][0];
//    ptStar[0][1] = *ptiStar[0][1];
//    ptStar[1][1] = *ptiStar[1][1];
//    ptStar[0][2] = *ptiStar[0][2];
//    ptStar[1][2] = *ptiStar[1][2];
//    return;
//}






